<?php
namespace app\api\model;
use think\Model;
use think\model\concern\SoftDelete;
class NursingOrder extends Model
{
    use SoftDelete;
    protected $name = "nursing_order";
    protected $pk = "id";
    protected $deleteTime = "delete_time";
    protected $defaultSoftDelete = 0;
    protected $json = ['nanny_options_ids'];
    protected $jsonAssoc = true;
    public function nursingLang(){
        return $this->hasOne(NursingLang::class,'id','nursing_lang_id');
    }
    public function getAssessmentTimeAttr($value){
        if($value){
            $value = date('Y-m-d H:i',$value);
        }else{
            $value = '';
        }
        return $value;
    }
    public function getServiceTimeAttr($value){
        if($value){
            $value = date('Y-m-d H:i',$value);
        }else{
            $value = '';
        }
        return $value;
    }
    public function getPurchaseTimeAttr($value){
        if($value){
            $value = date('Y-m-d H:i',$value);
        }else{
            $value = '';
        }
        return $value;
    }
    public function getEndTimeAttr($value){
        if($value){
            $value = date('Y-m-d H:i',$value);
        }else{
            $value = '';
        }
        return $value;
    }
}